﻿Imports System.Windows.Controls
Namespace LightSwitchApplication

    Public Class EmployeePayrollHistory

        
        Private Sub EmployeePayrollHistory_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            ' Write your code here.
            
        End Sub

       
      

        Private Sub Employee_SelectionChanged()
            'If Employee.SelectedItem.PayHistory(0) Is Nothing OrElse Employee.SelectedItem.PayHistory(0).PayPeriodItem.Status = 0 Then
            '    If ShowMessageBox("No payroll data defined for this pay period", "Warning", MessageBoxOption.YesNo) = Windows.MessageBoxResult.Yes Then
            '        Dim x = Me.DataWorkspace.ApplicationData.PayHistory.AddNew
            '        x.EmployeeItem = Employee.SelectedItem
            '        x.PayPeriodItem = CurrentPayPeriod.First
            '        x.CreatedBy = Application.Current.User.Name
            '        x.DateCreated = Now

            '        Me.DataWorkspace.ApplicationData.SaveChanges()
            '    End If
            'End If
        End Sub

        Private Sub EmployeePayrollHistory_Saved()
            ' Write your code here.
            CurrentPayroll.Refresh()
        End Sub

        Private Sub Employee_Loaded(succeeded As Boolean)
            
        End Sub

        'Sub YourTabControl_ControlAvailable(sender As Object, e As ControlAvailableEventArgs)
        '    Dim tabControl = DirectCast(e.Control, TabControl)
        '    tabControl.SelectedIndex = 2
        '    ' 0=first tab, 1=second tab, etc
        'End Sub

        'Private Sub EmployeePayrollHistory_Created()
        '    ' Write your code here.
        '    Dim proxy = Me.FindControl("CurrentPayrollTab")
        '    AddHandler proxy.ControlAvailable, AddressOf YourTabControl_ControlAvailable

        'End Sub
    End Class

End Namespace
